{% extends "base.html" %}
{% block title %}Poll{% endblock %}
{% block content %}
<h2>{{ poll.question|escape }}</h2>
<div>
  <div class="poll">
    <dl>
      <dt>Question</dt>
      <dd><span class="question">{{ poll.question|escape }}</span></dd>
      <dt>Answers</dt>
      <dd>
        <ul class="answers">
        {% for a in poll.answers %}
          <li class="answer"><a href="#" class="vote" data-poll="{{ poll.key.name }}" data-tag="{{ a|escape }}">vote</a>: {{ a|escape }} (<span id="{{ poll.key.name }}--{{ a|escape }}" class="votes" data-poll="{{ poll.key.name }}" data-tag="{{ a|escape }}">Loading votes...</span>)</li>
        {% endfor %}
        </ul>
      </dd>
    </dl>
    <span class="q-date">{{ poll.created|date }}</span><br/>
    <div>
      <h3>Share</h3>
      <a href="http://twitter.com/share" class="twitter-share-button"
          data-url="http://tagpoll-app.appspot.com/polls/{{ poll.key.name }}"
          data-text="{{ poll.question|escape }} {% for a in poll.answers %}#{{ a|escape }} {% endfor %}#tagpoll"
          data-count="horizontal">Tweet</a>
    </div>
    <div>
      <form action="{{ poll.key.name }}?delete" method="POST">
      This poll sucks! <input type="submit" value="Delete it!"/>
      </form>
    </div>
  </div>
</div>
{% endblock %}
